from Autotests.LocalMachine.Pages.BaseDialog import BaseWebDialog
from Autotests.LocalMachine.Controls.Button import WebButton
from Autotests.LocalMachine.Controls.BaseControl import BaseWebControl
from Autotests.LocalMachine.UiObjectsMap.AirClient import MainFrame, Dialog, Options


class OptionsPage(BaseWebDialog):
    def __init__(self):
        super(OptionsPage, self).__init__()
        self._dialogOptions = BaseWebControl(Options.winDialogOptions)

    def save(self):
        WebButton(Dialog.btnSaveOptions).click()

    def cancel(self):
        WebButton(Dialog.btnCancelOptions).click()

    def goToHomeLocation(self):
        super(OptionsPage, self).goToHomeLocation()
        WebButton(MainFrame.btnOptions).click()